/*
var str = '涛哥正在完dangang '
console.log(str.length)
console.log(str.charAt(0),str[0])
*/
/*
var str='javascript';
for (var i = 0, j = 0;i < str.length ;i++ ){
	if (str[i] === 'a'){
		j++
	}
}
console.log(j)
*/
/*
//统计字符串中最多字符是哪一个,并且统计次数
var str='javascript';
console.log(str.indexOf('scr'));
console.log(str.lastIndexOf('a'))*/
/*
var str = '54545@1551'
if (str.indexOf('@') != -1){
	console.log('邮箱格式正确')
}else{
	console.log('格式错误')
	}
*/
/*
//英文字母大小写转换
var str =  'JavaScript'
console.log(str.toUpperCase())
console.log(str.toLowerCase())
*/
/*
var str =  'JavaScript'
//console.log(str.slice(4));
console.log(str.slice(4,7));
*/
/*
var str = 'tao123@tedu.cn'

var str1 = str.slice(0,str.indexOf('@'))
var str2 = str.slice(str.indexOf('@')+1)
console.log(str1)
console.log(str2)
*/
/*
var str =  'JavaScript';
console.log(str.substr(4));
console.log(str.substr(4,3));
console.log(str.substr(-3,2))
*/
/*
var str = '110235197307151870'
var str1 = str.substr(6,8);
var str2 = str.substr(-2,1)
var nian = str1.substr(0,4)
var yue = str1.substr(4,2)
var ri = str1.substr(-2,2)
if (str2%2!=0){
	console.log(nian+'年'+yue+'月'+ri+'日'+' '+'性别:'+'男')
}else{
	console.log(nian+'年'+yue+'月'+ri+'日'+' '+'性别:'+'女')
	}
*/
/*
var arr = ['a','b','c','d'];
var str = arr.join('/')
console.log(str);
console.log(str.split('/'));
*/
//截取文件的后缀名
var srt='web.2014.tao.jpg'
var arr = srt.split('.')
console.log(arr);
console.log(arr[arr.length-1])
